Closed loop control of drilling toolface

ABSTRACT

A downhole closed loop method for controlling a drilling toolface includes measuring first and second attitudes of the subterranean borehole at corresponding first and second upper and lower survey stations. The first and second attitudes are processed downhole while drilling to compute an angle change of the subterranean borehole between the upper and lower survey stations. The computed angle change is compared with a predetermined threshold. This process may be continuously repeated while the angle change is less than the threshold. The first and second attitudes are further processed downhole to compute a toolface angle when the angle change of the subterranean borehole is greater than or equal to the threshold. The toolface angle may then be further processed to control a direction of drilling of the subterranean borehole.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.16/243,125, filed Jan. 9, 2019, which issues as U.S. Pat. No. 10,995,552on May 4, 2021, which is a continuation of U.S. patent application Ser.No. 14/766,127, now U.S. Pat. No. 10,214,964 issued on Feb. 26, 2019,which is a national stage application of PCT Application No.PCT/US2014/031176 filed on Mar. 19, 2014, which claims priority to U.S.Provisional Patent Application No. 61/806,522 filed on Mar. 29, 2013,the entirety of each of which are incorporated herein by reference.

FIELD OF THE INVENTION

Disclosed embodiments relate generally to methods for maintainingdirectional control during downhole directional drilling operations andmore particularly to method for determining a downhole toolface offsetwhile drilling.

BACKGROUND

The use of automated drilling methods is becoming increasingly common indrilling subterranean wellbores. Such methods may be employed, forexample, to control the direction of drilling based on various downholefeedback measurements, such as inclination and azimuth measurements madewhile drilling or logging while drilling measurements.

One difficulty with automated drilling methods (and directional drillingmethods in general) is that directional drilling tools exhibittendencies to drill (or turn) in a direction offset from the set pointdirection. For example, when set to drill a horizontal well straightahead, certain drilling tools may have a tendency to drop inclination(turn downward) and/or to turn to the left or right. Exacerbating thisdifficulty, these tendencies can be influenced by numerous factors andmay change unexpectedly during a drilling operation. Factors influencingthe directional tendency may include, for example, properties of thesubterranean formation, the configuration of the bottom hole assembly(BHA), bit wear, bit/stabilizer walk, an unplanned touch point (e.g. dueto compression and buckling of the BHA), stabilizer-formationinteraction, the steering mechanism utilized by the steering tool, andvarious drilling parameters.

In current drilling operations, a drilling operator generally correctsthe directional tendencies by evaluating wellbore survey datatransmitted to the surface. A surface computation of the gravitytoolface of the well is generally performed at 30 to 100 foot intervals(e.g., at the static survey stations). While such techniques areserviceable, there is a need for further improvement, particularly forautomatically accommodating (or correcting) such tendencies downholewhile drilling.

SUMMARY

A downhole closed loop method for controlling a drilling toolface of asubterranean borehole is disclosed. The method includes receivingreference and measured attitudes of the subterranean borehole whiledrilling with the reference attitude being measured at an upper surveystation and the measured attitude being measured at a lower surveystation. The reference attitude and the measured attitude are processeddownhole while drilling (using a downhole processor) to compute an anglechange of the subterranean borehole between the upper and lower surveystations. The computed angle change is compared with a predeterminedthreshold. This process may be continuously repeated while the anglechange is less than the threshold. The reference attitude and themeasured attitude are further processed downhole to compute a toolfaceangle when the angle change of the subterranean borehole is greater thanor equal to the threshold. The toolface angle may then be furtherprocessed to control a direction of drilling of the subterraneanborehole.

The disclosed embodiments may provide various technical advantages. Forexample, the disclosed embodiments provide for real-time closed loopcontrol of the drilling toolface. As such, the disclosed methods mayprovide for improved well placement and reduced wellbore tortuosity.Moreover, by providing for closed loop control, the disclosed methodstend to improve drilling efficiency and consistency.

This summary is provided to introduce a selection of concepts that arefurther described below in the detailed description. This summary is notintended to identify key or essential features of the claimed subjectmatter, nor is it intended to be used as an aid in limiting the scope ofthe claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the disclosed subject matter, andadvantages thereof, reference is now made to the following descriptionstaken in conjunction with the accompanying drawings, in which:

FIG. 1 depicts an example drilling rig on which disclosed embodimentsmay be utilized.

FIG. 2 depicts a lower BHA portion of the drill string shown on FIG. 1.

FIG. 3 depicts a diagram of attitude and steering parameters in a globalcoordinate reference frame.

FIG. 4 depicts a diagram of gravity toolface and magnetic toolface in aglobal reference frame.

FIG. 5 depicts a flow chart of one disclosed closed loop methodembodiment for obtaining the drilling toolface.

FIG. 6 depicts one embodiment of a controller by which the toolfaceangle obtained in the method depicted on FIG. 5 may be processed tocontrol the direction of drilling.

FIG. 7 depicts a cascade controller that may process the toolface angleobtained in the method depicted on FIG. 5 to drive the drilling tool toa target azimuth.

DETAILED DESCRIPTION

FIG. 1 depicts a drilling rig 10 suitable for using various method andsystem embodiments disclosed herein. A semisubmersible drilling platform12 is positioned over an oil or gas formation (not shown) disposed belowthe sea floor 16. A subsea conduit 18 extends from deck 20 of platform12 to a wellhead installation 22. The platform may include a derrick anda hoisting apparatus for raising and lowering a drill string 30, which,as shown, extends into borehole 40 and includes a bottom hole assembly(BHA) 50. The BHA 50 includes a drill bit 32, a steering tool 60 (alsoreferred to as a directional drilling tool), and one or more downholenavigation sensors 70 such as measurement while drilling sensorsincluding three axis accelerometers and/or three axis magnetometers. TheBHA 50 may further include substantially any other suitable downholetools such as a downhole drilling motor, a downhole telemetry system, areaming tool, and the like. The disclosed embodiments are not limited inregards to such other tools.

It will be understood that the BHA may include substantially anysuitable steering tool 60, for example, including a rotary steerabletool. Various rotary steerable tool configurations are known in the artincluding various steering mechanisms for controlling the direction ofdrilling. For example, many existing rotary steerable tools include asubstantially non-rotating outer housing employing blades that engagethe borehole wall. Engagement of the blades with the borehole wall isintended to eccenter the tool body, thereby pointing or pushing thedrill bit in a desired direction while drilling. A rotating shaftdeployed in the outer housing transfers rotary power and axialweight-on-bit to the drill bit during drilling. Accelerometer andmagnetometer sets may be deployed in the outer housing and therefore arenon-rotating or rotate slowly with respect to the borehole wall.

The POWERDRIVE® rotary steerable systems (available from Schlumberger)fully rotate with the drill string (i.e., the outer housing rotates withthe drill string). The POWERDRIVE® XCEED™ makes use of an internalsteering mechanism that does not require contact with the borehole walland enables the tool body to fully rotate with the drill string. ThePOWERDRIVE® X5, X6, and POWERDRIVE ORBIT® rotary steerable systems makeuse of mud actuated blades (or pads) that contact the borehole wall. Theextension of the blades (or pads) is rapidly and continually adjusted asthe system rotates in the borehole. The POWERDRIVE ARCHER® makes use ofa lower steering section joined at an articulated swivel with an uppersection. The swivel is actively tilted via pistons so as to change theangle of the lower section with respect to the upper section andmaintain a desired drilling direction as the bottom hole assemblyrotates in the borehole. Accelerometer and magnetometer sets may rotatewith the drill string or may alternatively be deployed in an internalroll-stabilized housing such that they remain substantially stationary(in a bias phase) or rotate slowly with respect to the borehole (in aneutral phase). To drill a desired curvature, the bias phase and neutralphase are alternated during drilling at a predetermined ratio (referredto as the steering ratio). Again, the disclosed embodiments are notlimited to use with any particular steering tool configuration.

The downhole sensors 70 may include substantially any suitable sensorarrangement used making downhole navigation measurements (boreholeinclination, borehole azimuth, and/or tool face measurements). Suchsensors may include, for example, accelerometers, magnetometers,gyroscopes, and the like. Such sensor arrangements are well known in theart and are therefore not described in further detail. The disclosedembodiments are not limited to the use of any particular sensorembodiments or configurations. Methods for making real-time whiledrilling measurements of the borehole inclination and borehole azimuthare disclosed, for example, in commonly assigned U.S. PatentPublications 2013/0151157 and 2013/0151158. In the depicted embodiment,the sensors 70 are shown to be deployed in the steering tool 60. Such adepiction is merely for convenience as the sensors 70 may be deployedelsewhere in the BHA.

It will be understood by those of ordinary skill in the art that thedeployment illustrated on FIG. 1 is merely an example. It will befurther understood that disclosed embodiments are not limited to usewith a semisubmersible platform 12 as illustrated on FIG. 1. Thedisclosed embodiments are equally well suited for use with any kind ofsubterranean drilling operation, either offshore or onshore.

FIG. 2 depicts the lower BHA portion of drill string 30 including drillbit 32 and steering tool 60. As described above with respect to FIG. 1,the steering tool may include navigation sensors 70 including tri-axial(three axis) accelerometer and magnetometer navigation sensors. Suitableaccelerometers and magnetometers may be chosen from among substantiallyany suitable commercially available devices known in the art. FIG. 2further includes a diagrammatic representation of the tri-axialaccelerometer and magnetometer sensor sets. By tri-axial it is meantthat each sensor set includes three mutually perpendicular sensors, theaccelerometers being designated as A_(x), A_(y), and A_(z) and themagnetometers being designated as B_(x), B_(y), and B_(z). Byconvention, a right handed system is designated in which the z-axisaccelerometer and magnetometer (A_(z) and B_(z)) are orientedsubstantially parallel with the borehole as indicated (althoughdisclosed embodiments are not limited by such conventions). Each of theaccelerometer and magnetometer sets may therefore be considered asdetermining a plane (the x and y-axes) and a pole (the z-axis along theaxis of the BHA).

FIG. 3 depicts a diagram of attitude in a global coordinate referenceframe at first and second upper and lower survey stations 82 and 84. Theattitude of a BHA defines the orientation of the BHA axis (axis 86 atthe upper survey station 82 and axis 88 at the lower survey station 84)in three-dimensional space. In wellbore surveying applications, thewellbore attitude represents the direction of the BHA axis in the globalcoordinate reference frame (and is commonly understood to beapproximately equal to the direction of propagation of the drill bit).Attitude may be represented by a unit vector the direction of which isoften defined by the borehole inclination and the borehole azimuth. InFIG. 2 the borehole inclination at the upper and lower survey stations82 and 84 is represented by Inc_(up) and Inc_(low) while the boreholeazimuth is represented by Azi_(up) and Azi_(low). The angle β representsthe overall angle change of the borehole between the first and secondsurvey stations 82 and 84.

FIG. 4 depicts a further diagram of attitude and toolface in a globalcoordinate reference frame at the second lower survey station 84. TheEarth's magnetic field and gravitational field are depicted at 91 and92. The borehole inclination Mom, represents the deviation of axis 88from vertical while the borehole azimuth Azi_(low), represents thedeviation of a projection of the axis 88 on the horizontal plane frommagnetic north. Gravity toolface (GTF) is the angular deviation aboutthe circumference of the downhole tool of some tool component withrespect to the highside (HS) of the tool collar (or borehole). In thisdisclosure gravity tool face (GTF) represents the angular deviationbetween the direction towards which the drill bit is being turned andthe highside direction (e.g., in a slide drilling operation, the gravitytool face represents the angular deviation between a bent sub scribeline and the highside direction). Magnetic toolface (MTF) is similar toGTF but uses magnetic north as a reference direction. In particular, MTFis the angular deviation in the horizontal plane between the directiontowards which the drill bit is being turned and magnetic north.

It will be understood that the disclosed embodiments are not limited tothe above described conventions for defining borehole coordinatesdepicted in FIGS. 2, 3, and 4. It will be further understood that theseconventions can affect the form of certain of the mathematical equationsthat follow in this disclosure. Those of ordinary skill in the art willbe readily able to utilize other conventions and derive equivalentmathematical equations.

FIG. 5 depicts a flow chart of one disclosed closed loop methodembodiment 100 for obtaining the drilling toolface. A subterraneanborehole is drilled at 102, for example, via rotating a drill string,pumping drilling fluid through a downhole mud motor, or the like. Adirectional drilling tool (steering tool) may also be actuated so as tocontrol the direction of drilling (the drilling attitude) and therebysteer the drill bit. A reference attitude is received at 104. Thereference attitude may include, for example, a previously measuredattitude. A measured attitude is received 106. The reference andmeasured attitudes may include inclination and azimuth values measuredusing substantially any suitable downhole sensor arrangements, forexample, including the aforementioned accelerometers, magnetometers, andgyroscopic sensors. The reference attitude may include a previouslymeasured attitude obtained from an upper survey station while themeasured attitude may include a currently measured attitude obtainedfrom a lower survey station.

At 108 the reference and measured attitudes are processed to compute anoverall angle change β of the borehole between first and second surveystations (see FIG. 3). The angle β is then compared with a predeterminedthreshold value at 110. When β is less than the threshold, the methodreturns to 106 and receives a subsequent measured attitude (an attitudemeasured later in time as compared to the previously measured attitude)and then re-computes β at 108. When β is greater than or equal to thethreshold value at 110, the reference and measured attitudes are furtherprocessed at 112 to compute the toolface angle (e.g., the GTF and/or theMTF) of the drill bit (i.e., the tool face angle towards which the drillbit is turning). The computed toolface angle is then further processedat 200 as described in more detail below with respect to FIGS. 6 and 7to control the direction of drilling. At 114 the reference attitude(originally received at 104) is reset such that it equals the mostrecently measured attitude received at 106. The method then cycles backto 106 and receives another measured attitude and then re-computes β at108.

The attitude received at 106 may be measured, for example, using staticand/or continuous inclination and azimuth measurement techniques. Staticmeasurements may be obtained, for example, when drilling is temporarilysuspended to add a new pipe stand to the drill string. Continuousmeasurements may be obtained, for example, from corresponding continuousmeasurements of the axial component of the gravitational and magneticfields (A_(z) and B_(z) in FIG. 2) using techniques known to those ofordinary skill in the art (e.g., as disclosed in U.S. Patent Publication2013/0151157 which is fully incorporated by reference herein). Thecontinuous inclination and azimuth measurements may further be filteredto reduce the effects of noise. For example, a suitable digital filtermay include a first-order infinite impulse response (IIR) filter. Suchfiltering techniques are also known to those of ordinary skill in theart and need not be discussed further herein.

The reference and measured attitudes may be processed at 108 to computethe angle β between the upper and lower survey stations, for example, asfollows:

β=arccos{cos(Inc_(low)−Inc_(up))−sin(Inc_(low))sin(Inc_(up))[1−cos(Azi_(low)−Azi_(up))]}  (1)

where Inc_(low) and Azi_(low) represent the measured attitude(inclination and azimuth) and Inc_(up) and Azi_(up) represent thereference attitude (inclination and azimuth). Given that the overallangle change of the well is often small in a continuous drillingoperation, one or more of the following approximations may be used whenβ is small (e.g., less than about 5 degrees):

$\begin{matrix}{\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin( {Inc}_{low} )}{\sin( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}} & (2) \\{\mspace{79mu}{\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin^{2}( {Inc}_{low} )}( {{Azi_{\iota ow}} - {Azi_{up}}} )^{2}}}}} & (3) \\{\mspace{79mu}{\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin^{2}( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}}} & (4)\end{matrix}$

When making continuous (while drilling) attitude measurements, thecontinuous azimuth measurements are commonly noisier than the continuousinclination measurements. As such, Equations 2-4 may be modified toinclude a weighting factor AW to desensitize the effect of the noisierazimuth on the overall angle change β.

$\begin{matrix}{\beta_{weighted} = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{AW}\;{\sin( {Inc}_{low} )}{\sin( {Inc}_{up} )}( {{Azi_{\iota ow}} - {Azi_{up}}} )^{2}}}} & (5) \\{\beta_{weighted} = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {AW{\sin^{2}( {Inc}_{low} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}} & (6) \\{\beta_{weighted} = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {AW{\sin^{2}( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}} & (7)\end{matrix}$

wherein the weighting factor AW is in a range from 0 to 1 and may beselected based on the noise levels in the inclination and azimuthvalues. In certain embodiments, the weighting factor AW may be in arange from about 0.1 to about 0.5 (although the disclosed embodimentsare by no means limited in this regard). Equations 2-7 may beadvantageously utilized on a downhole computer/processor as they reducethe number of trig functions (which tend to use substantialcomputational resources).

Substantially any suitable threshold may be used at 110, for example, ina range from about 0.25 to about 2.5 degrees. In general increasing thevalue of the threshold reduces the error in the toolface value computedat 112. In one embodiment, a toolface error in a range from about 5-10degrees may be achieved using a threshold value of 0.5 degrees. Using athreshold value of 1.0 degree may advantageously further reduce thetoolface error. It will be understood that the threshold is related tothe curvature of the wellbore section being drilled and the distancedrilled. For example, at a curvature of 5 degrees per 100 feet ofwellbore, a threshold of 0.5 degrees corresponds to a distance drilledof 10 feet. As such the control loop depicted in FIG. 5 may be thoughtof as being a substantially depth-domain controller.

It will be further understood that the measured value of β may beprocessed downhole to obtain an approximate rate of penetration ROP ofdrilling, for example, as follows:

$\begin{matrix}{{ROP} = \frac{\beta}{\Delta\;{t \cdot {DLS}}}} & (8)\end{matrix}$

where DLS represents the dogleg severity (curvature) of the boreholesection being drilled and Δt represents the time passed between makingmeasurements at the first and second upper and lower survey stations.This estimated ROP may be advantageously used, for example, to projectthe continuous survey sensor measurements to the bit (or other locationsin the string). It will be understood that “static” and/or substantiallycontinuous ROP values may be computed. For example, a static ROP may becomputed at 112 when β exceeds the threshold. A substantially continuousROP may be computed, for example, at 108 when computing β thereby givinga near instantaneous rate of penetration. Such a near instantaneous rateof penetration may optionally be filtered, for example, using a rollingaverage window or other filtering technique.

The reference and measured attitudes may be further processed at 112 tocompute the GTF or MTF angles, for example, as follows:

$\begin{matrix}{\mspace{79mu}{{GTF} = {\arctan\lbrack \frac{{\sin( {{In}c_{low}} )}{\sin( {{Azi_{low}} - {Azi_{up}}} )}}{\begin{matrix}{{{\cos( {Inc}_{up} )}{\sin( {{In}c_{low}} )}{\cos( {{{Az}i_{low}} - {Azi_{up}}} )}} -} \\{{\sin( {{In}c_{up}} )}{\cos( {{In}c_{low}} )}}\end{matrix}} \rbrack}}} & (9) \\{{{MTF} = {\arctan\lbrack \frac{\begin{matrix}{{{\cos^{2}( {Inc}_{up} )}{\sin( {Inc}_{low} )}{\sin( {Azi_{low}} )}} -} \\{{{\sin( {Inc}_{up} )}{\cos( {Inc}_{up} )}{\sin( {Azi_{up}} )}{\cos( {Inc}_{low} )}} +} \\{{\sin^{2}( {Inc}_{up} )}{\sin( {Inc}_{low} )}{\cos( {Azi_{up}} )}{\sin( {{Azi_{low}} - {Azi_{up}}} )}}\end{matrix}}{\begin{matrix}{{{\cos^{2}( {Inc}_{up} )}{\sin( {Inc}_{low} )}{\cos( {Azi_{low}} )}} -} \\{{{\sin( {Inc}_{up} )}{\cos( {Inc}_{up} )}{\cos( {Azi_{up}} )}{\cos( {Inc}_{low} )}} -} \\{{\sin^{2}( {Inc}_{up} )}{\sin( {Inc}_{low} )}{\sin( {Azi_{up}} )}{\sin( {{Azi_{low}} - {Azi_{up}}} )}}\end{matrix}} \rbrack}}\;} & (10)\end{matrix}$

An approximate GTF may be computed based on the assumption that β issmall (e.g., less than about 5 degrees), for example, as follows:

$\begin{matrix}{{GTF} = {\arctan( \frac{( {{Azi_{low}} - {Azi_{up}}} ){\sin( {Inc}_{up} )}}{{Inc}_{low} - {Inc}_{up}} )}} & (11)\end{matrix}$

Likewise, an approximate MTF may be computed when the boreholeinclination is small (e.g., less than about 5 degrees) at the upper andlower survey stations, for example, as follows:

$\begin{matrix}{{MTF} = {\arctan( \frac{{{\sin( {Inc}_{low} )}{\sin( {Azi_{low}} )}} - {{\sin( {Inc}_{up} )}{\sin( {Azi_{up}} )}}}{{{\sin( {Inc}_{low} )}{\cos( {Azi_{low}} )}} - {{\sin( {Inc}_{up} )}{\cos( {Azi_{up}} )}}} )}} & (12)\end{matrix}$

Equations 11 and 12 require less intensive computation and may thereforebe advantageous when implementing the disclosed method on a downholecontroller. It will be understood that the MTF and/or the GTF mayalternatively (and/or additionally) be computed using other knownmathematical relations, for example, utilizing inclination and magneticdip angle or inclination, azimuth, and magnetic dip angle. Suchmathematical relations are disclosed, for example, in U.S. Pat. No.7,243,719 and U.S. Patent Publication 2013/0126239, each of which isincorporated by reference in its entirety herein.

The computed toolface values may be compared with a toolface set pointvalue to compute toolface offset values (the error or offset between theset point value and the actual measured value) in substantially realtime while drilling. The toolface offset values may be further processedto obtain a transfer function of the directional drilling system. Thistransfer function may be further evaluated in combination with variousdrilling and BHA parameters (e.g., formation type, rate of penetration,BHA configuration, etc) to evaluate the performance of the drillingsystem.

FIG. 6 depicts one embodiment of a controller 200 by which the toolfaceangle may be processed to control the direction of drilling. Thetoolface angle obtained from method 100 may be combined at 202 with thetoolface set point value (e.g., the desired toolface angle set by thedrilling operator) to obtain a toolface error. The toolface error may bein turn be combined at 204 with a previous toolface correction to obtaina current toolface correction which may be further combined at 206 withthe toolface set point value to obtain a toolface reference. It will beunderstood that the control structure depicted on FIG. 6 functions likea proportional integral (P+I) controller (with a P gain of 1) forchanges in the toolface set point value and like an integral onlycontroller when responding to toolface disturbances. The disclosedembodiments are of course not limited to any particular type ofcontroller. For example, other controllers such as a proportionalcontroller, a proportional differential controller, or a proportionalintegral differential controller may be used. Non classic controllers,such as a model predictive controller, a fuzzy controller, and the likemay also be used.

FIG. 7 depicts a cascade controller 200′ that may process the toolfaceangle obtained from method 100 to drive the drilling tool to a targetazimuth. The depicted controller includes a P+I outer closed loop 220 todrive the drill cycle survey azimuth to a target azimuth downlinked by adrilling operator and a P+I inner closed loop 240 to drive the measuredtoolface (MTF or GTF) to the target toolface. At the start of theimplantation (e.g., at the beginning of an automated drilling operation)it may be desirable to disable (switch off) the outer loop 220 to enablethe tuning of the inner loop 240 via setting gains kpAzi and kpAzi equalto zero.

In the outer loop 220, the target azimuth targetAzi is combined at 222with the measured azimuth cAzi from method 100 to obtain an azimutherror signal: e₁ [n]=targetAzi−cAzi. The azimuth error signal is furthercombined at 224 with a weighted value of the measured inclination ksin(cInc) to obtain a weighted azimuthal error signal: e′₁ [n]=e₁[n]·k·sin (cInc). Proportional and integral gains of the weightedazimuthal error signal are computed at 226 and 228 and combined at 230to obtain a target toolface of the well: targetTF=kpAzi·e′₁[n]+kiAzi·Σ₁^(n)e′₁[n]. The target toolface may be either a GTF or a MTF and may beautomatically (or manually) selected at 235, for example, based on theinclination of the wellbore.

In the inner loop 240 a target GTF or a target MTF are computed andinput into control unit 260 that controls the direction of drilling.When the MTF/GTF switch 235 is set to select GTF, the target toolface ofthe well targetTF is combined at 242 with a GTF obtained from method 100to obtain a GTF error signal: e₃ [n]=targetTF−GTF. Proportional andintegral gains of the GTF error signal are computed at 244 and 246 andcombined at 248 to obtain the target GTF of the control unit:targetGTF=kpGTF·e₃ [n]+kiGTF·Σ₁ ^(n)e₃ [n]. When the MTF/GTF switch 235is set to select MTF, the target toolface of the well targetTF iscombined at 252 with an MTF obtained from method 100 to obtain an MTFerror signal: e₂ [n]=targetTF−MTF. Proportional and integral gains ofthe MTF error signal are computed at 254 and 256 and combined at 258 toobtain the target MTF of the control unit: targetMTF=kpMTF·e₂[n]+kiMTF·E₁ ^(n)e₂ [n].

The methods described herein are configured for downhole implementationvia one or more controllers deployed downhole (e.g., in asteering/directional drilling tool). A suitable controller may include,for example, a programmable processor, such as a microprocessor or amicrocontroller and processor-readable or computer-readable program codeembodying logic. A suitable processor may be utilized, for example, toexecute the method embodiments described above with respect to FIGS. 5,6, and 7 as well as the corresponding disclosed mathematical equations.A suitable controller may also optionally include other controllablecomponents, such as sensors (e.g., a depth sensor), data storagedevices, power supplies, timers, and the like. The controller may alsobe disposed to be in electronic communication with the attitude sensors(e.g., to receive the continuous inclination and azimuth measurements).A suitable controller may also optionally communicate with otherinstruments in the drill string, such as, for example, telemetry systemsthat communicate with the surface. A suitable controller may furtheroptionally include volatile or non-volatile memory or a data storagedevice.

With continued reference to FIG. 7, disclosed embodiments may furtherinclude a downhole steering tool having a downhole steering tool body, asteering mechanism for controlling a direction of drilling asubterranean borehole and sensors for measuring an attitude of thesubterranean borehole. The steering tool may further include a downholecontroller including (i) a toolface module having instructions (as inmethod 100 on FIG. 5) to process attitude measurements received from thesensors to obtain a drilling toolface, (ii) an outer control loop havinginstructions to process the attitude measurements received from thesensors and a target azimuth to obtain a target toolface, (iii) an innerloop having instructions to process the drilling toolface and the targettoolface to obtain an error signal, and (iv) a control unit targetincluding instructions to process the error signal to obtaininstructions for the steering mechanism for controlling the direction ofdrilling.

Although closed loop control of drilling toolface and certain advantagesthereof have been described in detail, it should be understood thatvarious changes, substitutions and alterations may be made hereinwithout departing from the spirit and scope of the disclosure as definedby the appended claims.

What is claimed is:
 1. A downhole steering tool comprising: a downholesteering tool body; a steering mechanism for controlling a direction ofdrilling a subterranean borehole; sensors for measuring an attitude ofthe subterranean borehole; and a downhole controller including one ormore modules having instructions to (i) process attitude measurementsreceived from the sensors at a first survey station and a second surveystation to compute an angle change between the first survey station andthe second survey station and (ii) process the angle change to compute arate of penetration while drilling.
 2. The downhole steering tool ofclaim 1, wherein the rate of penetration while drilling is computedusing the following mathematical equation:${ROP} = \frac{\beta}{{\Delta t} \cdot {DLS}}$ where ROP represents therate of penetration of drilling, DLS represents a dogleg severity of thesubterranean borehole being drilled in (a), β represents the anglechange between the upper and lower survey stations, and Δt represents atime passed between measuring the reference attitude and the measuredattitude at the upper and lower survey stations.
 3. The downholesteering tool of claim 2, wherein the one or more modules further haveinstructions to compute the rate of penetration substantiallycontinuously while drilling.
 4. The downhole steering tool of claim 1,wherein the angle change of the subterranean borehole is computedprocessed using one or more of the following mathematical equations:${\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin^{2}( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};$${\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin^{2}( {Inc}_{low} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};{or}$${\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{\sin( {Inc}_{low} )}{\sin( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};$where β represents the angle change of the subterranean borehole,Inc_(low) and Azi_(low) represent the measured attitude at the lowersurvey station, and Inc_(up) and Azi_(up) represent the referenceattitude at the upper survey station.
 5. The downhole steering tool ofclaim 1, wherein the angle change of the subterranean borehole isprocessed using one or more of the following mathematical equations:$\mspace{20mu}{{\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {AW{\sin^{2}( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};}$$\mspace{20mu}{{\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {AW{\sin^{2}( {Inc}_{low} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};{or}}$${\beta = \sqrt{( {{Inc}_{low} - {Inc}_{up}} )^{2} + {{AW}\;{\sin( {Inc}_{low} )}{\sin( {Inc}_{up} )}( {{Azi_{low}} - {Azi_{up}}} )^{2}}}};$where β represents the angle change of the subterranean borehole,Inc_(low) and Azi_(low) represent the measured attitude at the lowersurvey station, and Inc_(up) and Azi_(up) represent the referenceattitude at the upper survey station, and AW represents a weightingfactor in a range from 0 to
 1. 6. The downhole steering tool of claim 5,where AW is in a range from about 0.1 to about 0.5.